﻿package core.ui.dialogs
{
    import core.enum.*;
    import core.event.*;
    import core.image.*;
    import core.ui.controls.*;

    public class PolarCoordinatesDialog extends BitmapOperationDialogBase
    {
        var f:Filter;
        var type:Dropdown;

        public function PolarCoordinatesDialog(param1:Tuyitu)
        {
            super(param1, "rm_polar_coordinates", 240, 130, Action.PolarCoordinatesFilter);
            this.f = new Filter();
            this.type = new Dropdown(180, 180);
            this.type.addEventListener(SelectEvent.COMMAND, this.Change);
            this.type.x = 20;
            this.type.y = 35;
            this.type.AddItem(U.RM("rm_rect_to_polar"), "0", true);
            this.type.AddItem(U.RM("rm_polar_to_rect"), "1");
            this.type.AddItem(U.RM("rm_invert_in_circle"), "2");
            this.type.Bind();
            addChild(this.type);
            return;
        }// end function

        override public function Change(... args) : void
        {
            if (!locked)
            {
                bm.copyPixels(bc, bm.rect, bm.rect.topLeft);
                this.f.PolarCoordinates(bm, bc, int(this.type.value), selection, offset);
            }
            return;
        }// end function

    }
}
